﻿using System.Web;

namespace Core
{
    public partial interface IWebHelper
    {
        string GetUrlReferrer();

        string GetCurrentIpAddress();

        string GetThisPageUrl(bool includeQueryString);

        string GetThisPageUrl(bool includeQueryString, bool useSsl);

        bool IsCurrentConnectionSecured();

        string ServerVariables(string name);

        string GetStoreHost(bool useSsl);

        string GetStoreLocation();

        string GetStoreLocation(bool useSsl);

        /// <summary>
        /// Returns true if the requested resource is one of the typical resources that needn't be processed by the cms engine.
        /// </summary>
        /// <param name="request">HTTP Request</param>
        /// <returns>True if the request targets a static resource file.</returns>
        /// <remarks>
        /// These are the file extensions considered to be static resources:
        /// .css
        ///	.gif
        /// .png 
        /// .jpg
        /// .jpeg
        /// .js
        /// .axd
        /// .ashx
        /// </remarks>
        bool IsStaticResource(HttpRequest request);

        string MapPath(string path);

        string ModifyQueryString(string url, string queryStringModification, string anchor);

        string RemoveQueryString(string url, string queryString);

        T QueryString<T>(string name);

        void RestartAppDomain(bool makeRedirect = false, string redirectUrl = "");

        bool IsRequestBeingRedirected { get; }

        bool IsPostBeingDone { get; set; }
    }
}
